<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Icon Exemple</title>
<link href="icons.css.php" rel="stylesheet" type="text/css" />
<style>
.btn{
	display:			inline-block;
	border:				1px solid #960;
	background-color:	#FC6;
	margin:				5px;
	padding:			5px;
	background-repeat:	no-repeat; 
	background-position:3px center;
	width:190px;
	overflow:hidden;
}
.title{
		
}
.frame{
	max-height:300px;	
	overflow:auto;
}
</style>
</head>

<body>
<?php

include('icons.conf.php');

//on ouvre le dossier courant afin de récupérer la liste de dossier à charger
$dir = 		@opendir('.');


if ($dir) {
	while (($file = readdir( $dir ) ) !== false ) {
		
		if ( substr($file, 0, 1) == '.' ) continue;
		
		if ( is_dir( './'.$file ) ) {
			
			$subdir = @ opendir('./'.$file );
			
			echo '<h1 class="title">Liste des icones au format '.$file.'</h1>';
			echo '<div class="frame">';
			if($subdir){
				
				while (($subfile = readdir( $subdir ) ) !== false ) {
					
					if( substr($subfile, -4) == '.png' ) {
						$iconname = strtolower(str_replace(' ', '-',str_replace('_', '-', substr($subfile, 0, strlen($subfile) - 4))));
						
						if(@$ICONS_TRANS[$iconname] != '') {
							$iconname = $ICONS_TRANS[$iconname];
						}
						
						echo '<div class="icon-' . $iconname . ($file == 16 ? "" : "-".$file) . ' btn" style=" padding-left:'.($file + 8).'px;min-width:'.($file + 8).'px; height:'.($file + 8).'px; line-height:'.($file + 8).'px;" >
							icon-' . $iconname . ($file == 16 ? "" : "-".$file).'</div>'; 
					}					
				}
			}
			echo '</div>';
		}
		
	}
}
?>
</body>
</html>